package com.guchenbo.example.lock;

import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.ReentrantLock;

/**
 * Created by CreGu on 2016/6/23.
 */
public class TestThread {

    private ReentrantLock lock = new ReentrantLock();

    public void m() {
        lock.lock();
    }

    public static void main(String[] args) throws InterruptedException {
        ReentrantLock lock = new ReentrantLock();


        lock.lock();
        Condition condition = lock.newCondition();

        System.out.println(condition);
        condition.await();
        new Thread(() -> {
            TestThread test = new TestThread();
            test.m();
        }).start();

        while (true) {

        }
    }
}
